<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDealLineTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('deal_line', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->decimal('min','10','2')->comment('最低价');
            $table->decimal('max','10','2')->comment('最高价');
            $table->decimal('price','10','2')->comment('官方价格');
            $table->decimal('deal_price','10','2')->comment('交易价格');
            $table->decimal('total','20','2')->comment('交易总量');
            $table->decimal('total_hand','20','8')->default(0)->comment('100算力产生的E格码');
            $table->decimal('total_e','20','8')->default(0)->comment('算力产生的E格码总量');
            $table->string('date')->comment('日期');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `deal_line` comment '交易价格线表';");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('deal_line');
    }
}
